home *** CD-ROM | disk | FTP | other *** search
/ Robotics & Artificial Int…3 (Professional Edition) / Robotics & Artificial Intelligence Tools 2003 (Professional Edition).iso / neural network tool and application / nsinstall.exe / data1.cab / DllSys_Files / BIASAXON / BKBIASA.C < prev    next >
Encoding:
C/C++ Source or Header  |  2002-03-08  |  1.3 KB  |  44 lines

  1. // Dynamic link library implementation of NeuroSolutions BackBiasAxon component 
  2.  
  3. #include "NSDLL.h"
  4.  
  5. /********************************/
  6. /* Backpropagation of component */
  7.  
  8. __declspec(dllexport) void performBackBiasAxon(
  9.     DLLData    *instance,    // Pointer to instance data (may be NULL)
  10.     DLLData    *dualInstance,    // Pointer to the forward axons instance data (may be NULL)
  11.     NSFloat    *data,         // Pointer to the layer of processing elements (PEs)
  12.     int     rows,        // Number of rows of PEs in the layer
  13.     int     cols,        // Number of columns of PEs in the layer
  14.     NSFloat    *error,     // Pointer to the sensitivity vector
  15.     NSFloat    *gradient     // Pointer to the bias gradient vector
  16.     )
  17.     
  18. {
  19.     int i, length=rows*cols;
  20.  
  21.     if (gradient) 
  22.         for (i=0; i<length; i++)
  23.             gradient[i] += error[i];
  24. }
  25.  
  26. /******************************************/
  27. /* Management of instance data (OPTIONAL) */
  28. /*
  29. __declspec(dllexport) DLLData *allocBackBiasAxon(
  30.     DLLData    *oldInstance,    // Pointer to the last instance if reallocating
  31.     DLLData    *dualInstance,    // Pointer to forward axonÆs instance data (may be NULL)
  32.     int     rows,        // Number of rows of PEs in the layer
  33.     int     cols        // Number of columns of PEs in the layer
  34.     )
  35. {
  36.     DLLData *instance = allocDLLInstance(oldInstance);
  37.     return instance;
  38. }
  39.  
  40. __declspec(dllexport) void freeBackBiasAxon(DLLData *instance)
  41. {
  42.     freeDLLInstance(instance);
  43. }
  44. */